
const { DataTypes } = require('sequelize')

const seq = require('../db/seq.js')

const UserList = seq.define('user_list', ({
    id: {
        type: DataTypes.BIGINT,
        allowNull: false,
        primaryKey: true,
        comment: '歌单ID'
    },
    coverImgUrl: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: "歌曲图片"
    },
    name: {
        type: DataTypes.STRING,
        allowNull: false,
        comment: "专辑名称"
    },
    isFavorite: {
        type: DataTypes.INTEGER,
        allowNull: false,
        defaultValue: 1,
        conment: "歌单是否已保存"
    },
    user_id: { // 确保有定义 user_id 字段
        type: DataTypes.UUID,
        allowNull: false,
    },
}))

// UserList.sync({ force: true })

module.exports = UserList